#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <math.h>

int is_prime(int64_t num) {
    if (num == 0 || num == 1) {
        return 0;
    }
    for(int64_t i = 2; i * i <= num; i++) {
        //printf("num: %ld, i: %ld, num %% i: %ld\n", num, i, num % i);
        if (num % i == 0) {
            return 0;
        }
    }
    return 1;
}

int main(void) {
    int64_t num;
    while(scanf("%" SCNd64, &num) != EOF) {
        if (num == 0) break;
        puts(is_prime(num) ? "Yes" : "No");
    }
    return 0;
}
